Automatic Local Variables
Published on: Fri Mar 12 2010
Automatic Local Variables
- Variables defined inside a function
- Created each time a function is called
- Initialized and get a value each time
- Accessible inside function they are declared in only.
- Not available outside the function
The Stack Frame keeps an activation record For Example
Main variables
---------------
Printf variables
---------------
Another Function Variables
And so on.
Language translation is done by the compiler
Language implementation is done by the stack
Variable Scope
Score refers to the area of a program for which a variable is defined
Global Variable
- Declared above main
- Constants tend to be global
- No need to pass global var’s